negotiator.tournament
Class TournamentRunner
java.lang.Object
negotiator.tournament.TournamentRunner
- All Implemented Interfaces:
- java.lang.Runnable
public class TournamentRunner
- extends java.lang.Object
- implements java.lang.Runnable
TournamentRunner is a class that runs a tournament. It computes all combinations of the sessions from the Tournament
and then runs them sequentially.
Use with new Thread(new TournamentRunner(tournament,ael)).start();
You can use a null action event listener if you want to.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TournamentRunner
public TournamentRunner(java.util.List<Protocol> sessions,
NegotiationEventListener ael)
throws java.lang.Exception
- Parameters:
sessions - the sessions to be runael - the action event listener to use. If not null, the existing listener for each
session will be overridden with this listener.
- Throws:
java.lang.Exception
TournamentRunner
public TournamentRunner(Tournament t,
NegotiationEventListener ael)
throws java.lang.Exception
- Parameters:
t - the tournament to be runael - the action event listener to use. If not null, the existing listener for each
session will be overridden with this listener.
- Throws:
java.lang.Exception
TournamentRunner
public TournamentRunner(NegotiationEventListener ael,
boolean distributed,
java.lang.String sessionname)
TournamentRunner
public TournamentRunner(Tournament t,
NegotiationEventListener ael,
boolean runSingleSession)
throws java.lang.Exception
- Parameters:
t - the tournament to be runael - the action event listener to use. If not null, the existing listener for each
session will be overridden with this listener.
- Throws:
java.lang.Exception
run
public void run()
- Warning. You can call run() directly (instead of using Thread.start() )
but be aware that run() will not return until the tournament
has completed. That means that your interface will lock up until the tournament is complete.
And if any negosession uses modal interfaces, this will lock up swing, because modal
interfaces will not launch until the other swing interfaces have handled their events.
(at least this is my current understanding, Wouter, 22aug08).
See "java dialog deadlock" on the web...
- Specified by:
run in interface java.lang.Runnable
fireNegotiationSessionEvent
public void fireNegotiationSessionEvent(Protocol session)